package cn.cs.client;

import cn.cs.config.CsConfiguration;
import cn.cs.fallback.RepairBbsFallBack;
import cn.cs.fallback.SetPolicyFallBack;
import cn.cs.pojo.SetPolicy;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * Created by yuexl
 */
@FeignClient(name = "cs-user-provider", configuration = CsConfiguration.class, fallback = SetPolicyFallBack.class)
public interface SetPolicyClient {



    @RequestMapping(value = "/getSetPolicyById", method = RequestMethod.POST)
    public SetPolicy getSetPolicyById(@RequestParam("id") String id) throws Exception;

    @RequestMapping(value = "/getSetPolicyListByMap", method = RequestMethod.POST)
    public List<SetPolicy> getSetPolicyListByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/getSetPolicyCountByMap", method = RequestMethod.POST)
    public Integer getSetPolicyCountByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/addSetPolicy", method = RequestMethod.POST)
    public Integer addSetPolicy(@RequestBody SetPolicy setPolicy) throws Exception;

    @RequestMapping(value = "/modifySetPolicy", method = RequestMethod.POST)
    public Integer modifySetPolicy(@RequestBody SetPolicy setPolicy) throws Exception;

    @RequestMapping(value = "/deleteSetPolicyById", method = RequestMethod.POST)
    public Integer deleteSetPolicyById(@RequestParam("id") Long id) throws Exception;

    @RequestMapping(value = "/getSetPolicyByType", method = RequestMethod.POST)
    public Map<String, Object> getSetPolicyByType(@RequestParam("type") String type) throws Exception;

}

